package jtk.project4.fleet.screen.addEditNewEquipment;

import java.sql.SQLException;

import jtk.project4.fleet.FleetModel;
import jtk.project4.fleet.domain.TireCfg;
import jtk.project4.fleet.event.EquipmentEvent;
import nl.coderight.jazz.Controller;

public class AddEditEquipmentController extends Controller{
	private FleetModel fleetModel;
	private AddEditEquipmentView equipmentView;

	public void handleEvent(EquipmentEvent evt) throws SQLException{
		TireCfg tirecfg = fleetModel.getTirecfg();
		switch (evt.getType()){
		case SAVE:
			//System.out.println("tes : "+tirecfg.getType());
			//fleetModel.insertTireCfg(tirecfg);
			break;
		default:
			propagateEvent(evt);
			break;
		}
		
	}
	@Override
	public void execute() {
		// TODO Auto-generated method stub
		fleetModel = (FleetModel) getModel();
		equipmentView = new AddEditEquipmentView();
		setView(equipmentView);
		showView();
	}

}
